import { API_CONFIG } from "../config/index.js"
import  request from "../api/index.js"

//查询知识库信息表
export const getKnowledgeInfoHandler = (id,filePath,type) =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getKnowledgeInfoApi,{id,filePath,type},"GET",2000)
}

//删除资产分类信息
export const delKnowledgeInfoHandler = (id) =>{
    return request(API_CONFIG.delKnowledgeInfoApi(id),{},"DELETE",2000)
}
// 添加资产分类
export const addKnowledgeInfoHandler = (data) =>{
    return request(API_CONFIG.addKnowledgeInfoApi,data,"POST",2000)
}

// 修改资产分类
export const updateKnowledgeInfoHandler = (id,data) =>{
    return request(API_CONFIG.updateKnowledgeInfoApi(id),data,"PUT",2000)
}

//查询知识审批组信息
export const getKnowledgeReviewGroupInfoHandler = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getKnowledgeReviewGroupInfoApi,{},"GET",2000)
}

//删除审查审批组信息
export const delKnowledgeReviewGroupInfoHandler = (id) =>{
    return request(API_CONFIG.delKnowledgeReviewGroupInfoApi(id),{},"DELETE",2000)
}
// 添加审批组信息
export const addKnowledgeReviewGroupInfoHandler = (data) =>{
    return request(API_CONFIG.addKnowledgeReviewGroupInfoApi,data,"POST",2000)
}

// 修改审批组信息
export const updateKnowledgeReviewGroupInfoHandler = (id,data) =>{
    return request(API_CONFIG.updateKnowledgeReviewGroupInfoApi(id),data,"PUT",2000)
}


//查询知识库类型配置
export const getKnowledgeTypeInfoHandler = () =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getKnowledgeTypeInfoApi,{},"GET",2000)
}

//删除知识库类型
export const delKnowledgeTypeInfoHandler = (id) =>{
    return request(API_CONFIG.delKnowledgeTypeInfoApi(id),{},"DELETE",2000)
}
// 添加知识库类型
export const addKnowledgeTypeInfoHandler = (data) =>{
    return request(API_CONFIG.addKnowledgeTypeInfoApi,data,"POST",2000)
}

// 修改知识库类型
export const updateKnowledgeTypeInfoHandler = (id,data) =>{
    return request(API_CONFIG.updateKnowledgeTypeInfoApi(id),data,"PUT",2000)
}

// 查询知识库审核记录
export const getKnowledgeReviewRecordsInfoHandler = (code,reviewStatus) =>{
    /*
        {
            username: username,
            password: password
        }
        ==>简写位{username,password}
    */
    return request(API_CONFIG.getKnowledgeReviewRecordsInfoApi,{code,reviewStatus},"GET",2000)
}
// 添加知识库审核记录
export const addKnowledgeReviewRecordsInfoHandler = (data) =>{
    return request(API_CONFIG.addKnowledgeReviewRecordsInfoApi,data,"POST",2000)
}

// 知识库审核
export const updateKnowledgeReviewRecordsInfoHandler = (code,data) =>{
    return request(API_CONFIG.updateKnowledgeReviewRecordsInfoApi(code),data,"PUT",2000)
}